package com.hdoit.ares.logical.acc.dao.impl;

import org.springframework.stereotype.Component;

import com.hdoit.ares.logical.acc.dao.IIncomeInfoDao;
import com.hdoit.ares.logical.acc.model.IncomeInfo;
import com.tennetcn.common.dao.base.IFinderExpression;
import com.tennetcn.common.dao.base.impl.SuperDao;
import com.tennetcn.common.utils.FinderExpressionFactory;
/**
 * @author      lvsi
 * @email       
 * @createtime  2017年12月19日 14:18:12
 * @comment
 */
@Component
public class IncomeInfoDaoImpl extends SuperDao<IncomeInfo> implements IIncomeInfoDao{

	@Override
	public IncomeInfo queryIncomeInfo(String id) {
		IFinderExpression finderExpression=FinderExpressionFactory.createExpression();
		
		finderExpression.select("*")
						.from(IncomeInfo.class)
						.andEq("customerId",id);
		
	    return queryModel(finderExpression);
	}

	@Override
	public Double queryIncomeBalance(String id) {
		IFinderExpression finderExpression=FinderExpressionFactory.createExpression();
		
		finderExpression.select("incomeBalance")
						.from(IncomeInfo.class)
						.andEq("customerId",id);
		
	    return queryModel(finderExpression).getIncomeBalance();
	}

}